//
//  AddressCell.m
//  体育商城
//
//  Created by  on 2022/9/24.
//

#import "AddressCell.h"
@interface AddressCell()
@property (strong, nonatomic) IBOutlet UIButton *selectBtn;
@property (strong, nonatomic) IBOutlet UILabel *nickname;
@property (strong, nonatomic) IBOutlet UILabel *address;
@end
@implementation AddressCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(Address *)model{
    _model = model;
    self.selectBtn.selected = model.selected;
    self.selectBtn.hidden = model == nil;
    self.nickname.text = model ? [NSString stringWithFormat:@"%@  %@",model.name,model.phone] : LS(@"请新建收货地址");
    self.address.text = model ? model.address : LS(@"暂未获取到收货地址");
}
- (IBAction)actionForBtn:(UIButton *)sender {
    if (self.block) {
        self.block();
    }
}
@end
